package com.glsc.ngateway.common.base.repo.mysql.gateway.platform.webfield;

import com.glsc.ngateway.common.base.domain.mysql.gateway.platform.webfield.TableFormWebField;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

/**
 * @author zhengyr
 * @date 2024/2/2-8:53
 * 页面配置类主表（列表类型）
 */
@Repository
public interface TableFormWebFieldRepository extends JpaRepository<TableFormWebField, Integer>, JpaSpecificationExecutor<TableFormWebField> {

    @Query(value="select * from t_gw_table_form_web_field h "+
            "where deleted =0 "+
            "and if ( :pageName is not null, h.page_name like CONCAT('%', :pageName,'%'), 1=1) " +
            "", nativeQuery = true)
    Page<TableFormWebField> page(Pageable pageable, @Param("pageName") String pageName);

}
